package dto;

import com.jaay.DeepEntity;
import com.jaay.pojo.Order;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.Optional;

@Data
public class OrderDto implements DeepEntity<Order> {

    /**
     * 商户名称
     */
    private String merchantName;

    /**
     * 商品列表
     */
    private List<ProductDto> productList;

    @Override
    public Optional<Order> copy() {
        Order order = new Order();
        BeanUtils.copyProperties(this,order);
        return Optional.of(order);
    }
}
